
clear
set more off

**************
* Conjoint
**************


*General Results of Conjoint (Figure 4 in paper)
*- excluding the last attribute in the conjoint (linear function of the policy packages)
*- including individual level attributes (controls): gender, age (-> not shown in Figure but
*-- but included in table in appendix


foreach country in Germany UK Spain Italy Portugal {

	use "`country'_Conjoint.dta", clear

reg CJvote i.platform##i.leftid ib1.health_rec ib1.pension_rec ib1.educ_rec ib1.unemp_rec ib1.infra_rec i.tax_rec age gender [pweight=weighttoess], cl(id)
quietly coefplot, ///
keep(2.health_rec 2.pension_rec 2.educ_rec 2.unemp_rec 2.infra_rec 2.tax_rec 3.tax_rec) ///
xline(0) xscale(titlegap(*10) range(-.1 .1)) xlabel(-.1(.05).1) yline(5.5) ///
text(3 -.075 "Ref: Small", size(vsmall) orientation(vertical)) ///
text(6.5 -.075 "Ref: None", size(vsmall) orientation(vertical)) ///
text(3 .075 "Spending cuts", size(vsmall)) ///
text (6.5 .075 "Tax increase", size(vsmall)) ///
ylabel(1 "Public health care" 2 "Public pensions" 3 "Education" 4 "Unemployment benefits" 5 "Public infrastructure" 6 "Across the board" 7 "For wealthy only", labsize(vsmall)) ///
msymbol(O) msize(vsmall) ///
ciopts(lwidth(vthin)) scheme(plotplain) ///
xtitle("Impact on vote intention for policy proposal", size(vsmall)) ///
title(`country') saving(`country'_fig4.gph, replace) 

}


graph combine Germany_fig4.gph UK_fig4.gph Spain_fig4.gph ///
 Italy_fig4.gph  Portugal_fig4.gph
 
clear
  

*Figure 5 in paper*
*- by left/right voter

foreach country in Germany UK Spain Italy Portugal {

	use "`country'_Conjoint.dta", clear

 gen leftright=Q16
	
reg CJvote i.platform##i.leftid ib1.health_rec ib1.pension_rec ib1.educ_rec  ib1.unemp_rec ib1.infra_rec i.tax_rec age gender [pweight=weighttoess] if leftright<5, cl(id)
 estimates store res1
reg CJvote i.platform##i.leftid ib1.health_rec ib1.pension_rec ib1.educ_rec  ib1.unemp_rec ib1.infra_rec i.tax_rec age gender [pweight=weighttoess] if leftright>5 & leftright!=., cl(id)
 estimates store res2
quietly coefplot (res1, label("Left-wing voter (<5)")) (res2, label("Right-wing voter (>5)")), ///
keep(2.health_rec 2.pension_rec 2.educ_rec  2.unemp_rec 2.infra_rec 2.tax_rec 3.tax_rec) ///
xline(0) xscale(titlegap(*10) range(-.1 .1)) xlabel(-.1(.05).1) yline(5.5) yline(7.5) ///
text(3 -.08 "Ref: Small", size(vsmall) orientation(vertical)) ///
text(6.5 -.06 "Ref: None", size(vsmall)) ///
text(3 .07 "Large cuts", size(vsmall)) ///
text (6.5 .07 "Tax increase", size(vsmall)) ///
xtitle("Impact on vote for party", size(vsmall)) ///
ylabel(1 "Public health care" 2 "Public pensions" 3 "Education" 4 "Unemployment benefits" 5 "Public infrastructure" 6 "Across the board" 7 "For wealthy only", labsize(vsmall)) ///
 legend(position(6) rows(1) size(vsmall) bmargin(zero)) ///
title(`country') saving(`country'_fig5.gph, replace) nodraw

}


grc1leg2 Germany_fig5.gph UK_fig5.gph Spain_fig5.gph ///
Italy_fig5.gph  Portugal_fig5.gph, legendfrom(Germany_fig5.gph) 

  

